﻿<!-- DATACONTEXT = BubbleMatrixViewModel -->
<ItemsControl 
  x:Class="BubbleBurst.View.BubbleMatrixView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:view="clr-namespace:BubbleBurst.View"
  Background="White"
  IsEnabled="{Binding Path=IsIdle}"
  ItemsSource="{Binding Path=Bubbles, Mode=OneTime}"
  >
  
  <!-- All bubbles live in a BubbleCanvas panel. -->
  <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
      <view:BubbleCanvas Loaded="HandleBubbleCanvasLoaded" />
    </ItemsPanelTemplate>
  </ItemsControl.ItemsPanel>
  
  <!-- Render each BubbleViewModel with a BubbleView control. -->
  <ItemsControl.ItemTemplate>
    <DataTemplate>
      <view:BubbleView />
    </DataTemplate>
  </ItemsControl.ItemTemplate>
  
</ItemsControl>